

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>OneLogin saml2 Module &mdash; SAML Python library classes and methods</title>

    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="SAML Python library classes and methods" href="index.html" />
    <link rel="prev" title="Welcome to SAML Python library documentation" href="index.html" />
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Class Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="index.html" title="Welcome to SAML Python library documentation"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">SAML Python library classes and methods</a> &raquo;</li>
      </ul>
    </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">

  <div class="section" id="onelogin-saml2-package">
<h1>OneLogin saml2 Module<a class="headerlink" href="#onelogin-saml2-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="module-saml2.auth">
<span id="auth-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">auth</span></tt> Class<a class="headerlink" href="#module-saml2.auth" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="saml2.auth.OneLogin_Saml2_Auth">
<em class="property">class </em><tt class="descclassname">onelogin.saml2.auth.</tt><tt class="descname">OneLogin_Saml2_Auth</tt><big>(</big><em>request_data</em>, <em>old_settings=None</em><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.build_request_signature">
<tt class="descname">build_request_signature</tt><big>(</big><em>saml_request</em>, <em>relay_state</em><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.build_request_signature"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.build_request_signature" title="Permalink to this definition">¶</a></dt>
<dd><p>Builds the Signature of the SAML Request.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>saml_request</strong> (<em>string</em>) &#8211; The SAML Request</li>
<li><strong>relay_state</strong> (<em>string</em>) &#8211; The target URL the user should be redirected to</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.build_response_signature">
<tt class="descname">build_response_signature</tt><big>(</big><em>saml_response</em>, <em>relay_state</em><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.build_response_signature"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.build_response_signature" title="Permalink to this definition">¶</a></dt>
<dd><p>Builds the Signature of the SAML Response.
:param saml_request: The SAML Response
:type saml_request: string</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>relay_state</strong> (<em>string</em>) &#8211; The target URL the user should be redirected to</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.get_attribute">
<tt class="descname">get_attribute</tt><big>(</big><em>name</em><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.get_attribute"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.get_attribute" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the requested SAML attribute.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<em>string</em>) &#8211; Name of the attribute</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Attribute value if exists or None</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.get_attributes">
<tt class="descname">get_attributes</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.get_attributes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.get_attributes" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the set of SAML attributes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">SAML attributes</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.get_errors">
<tt class="descname">get_errors</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.get_errors"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.get_errors" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list with code errors if something went wrong</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">List of errors</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.get_last_error_reason">
<tt class="descname">get_last_error_reason</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.get_last_error_reason"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.get_last_error_reason" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the reason for the last error</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Error</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.get_nameid">
<tt class="descname">get_nameid</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.get_nameid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.get_nameid" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the nameID.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">NameID</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.get_settings">
<tt class="descname">get_settings</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.get_settings"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.get_settings" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the settings info
:return: Setting info
:rtype: OneLogin_Saml2_Setting object</p>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.get_slo_url">
<tt class="descname">get_slo_url</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.get_slo_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.get_slo_url" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the SLO url.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">An URL, the SLO endpoint of the IdP</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.get_sso_url">
<tt class="descname">get_sso_url</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.get_sso_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.get_sso_url" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the SSO url.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">An URL, the SSO endpoint of the IdP</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.is_authenticated">
<tt class="descname">is_authenticated</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.is_authenticated"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.is_authenticated" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if the user is authenticated or not.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if is authenticated, False if not</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.login">
<tt class="descname">login</tt><big>(</big><em>return_to=None</em>, <em>force_authn=False</em>, <em>is_passive=False</em><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.login"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.login" title="Permalink to this definition">¶</a></dt>
<dd><p>Initiates the SSO process.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>return_to</strong> (<em>string</em>) &#8211; Optional argument. The target URL the user should be redirected to after login.</li>
<li><strong>force_authn</strong> (<em>bool</em>) &#8211; Optional argument. When true the AuthNReuqest will set the ForceAuthn='true'.</li>
<li><strong>is_passive</strong> (<em>bool</em>) &#8211; Optional argument. When true the AuthNReuqest will set the Ispassive='true'.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Redirection url</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.logout">
<tt class="descname">logout</tt><big>(</big><em>return_to=None</em>, <em>name_id=None</em>, <em>session_index=None</em><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.logout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.logout" title="Permalink to this definition">¶</a></dt>
<dd><p>Initiates the SLO process.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th>
  <td class="field-body"><ul class="first simple">
<li><strong>return_to</strong> (<em>string</em>) &#8211; Optional argument. The target URL the user should be redirected to after logout.</li>
<li><strong>name_id</strong> (<em>string</em>) &#8211; Optional argument. The NameID that will be set in the LogoutRequest.</li>
<li><strong>session_index</strong> (<em>string</em>) &#8211; Optional argument. SessionIndex that identifies the session of the user.</li>
</ul></td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Redirection url</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.process_response">
<tt class="descname">process_response</tt><big>(</big><em>request_id=None</em><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.process_response"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.process_response" title="Permalink to this definition">¶</a></dt>
<dd><p>Process the SAML Response sent by the IdP.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>request_id</strong> (<em>string</em>) &#8211; Is an optional argumen. Is the ID of the AuthNRequest sent by this SP to the IdP.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body">OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND, when a POST with a SAMLResponse is not found</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.process_slo">
<tt class="descname">process_slo</tt><big>(</big><em>keep_local_session=False</em>, <em>request_id=None</em>, <em>delete_session_cb=None</em><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.process_slo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.process_slo" title="Permalink to this definition">¶</a></dt>
<dd><p>Process the SAML Logout Response / Logout Request sent by the IdP.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>keep_local_session</strong> (<em>bool</em>) &#8211; When false will destroy the local session, otherwise will destroy it</li>
<li><strong>request_id</strong> (<em>string</em>) &#8211; The ID of the LogoutRequest sent by this SP to the IdP</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Redirection url</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.redirect_to">
<tt class="descname">redirect_to</tt><big>(</big><em>url=None</em>, <em>parameters={}</em><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.redirect_to"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.redirect_to" title="Permalink to this definition">¶</a></dt>
<dd><p>Redirects the user to the url past by parameter or to the url that we defined in our SSO Request.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> (<em>string</em>) &#8211; The target URL to redirect the user</li>
<li><strong>parameters</strong> (<em>dict</em>) &#8211; Extra parameters to be passed as part of the url</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Redirection url</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.auth.OneLogin_Saml2_Auth.set_strict">
<tt class="descname">set_strict</tt><big>(</big><em>value</em><big>)</big><a class="reference internal" href="_modules/saml2/auth.html#OneLogin_Saml2_Auth.set_strict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.auth.OneLogin_Saml2_Auth.set_strict" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the strict mode active/disable</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> (<em>bool</em>) &#8211; </td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-saml2.authn_request">
<span id="authn-request-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">authn_request</span></tt> Class<a class="headerlink" href="#module-saml2.authn_request" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="saml2.authn_request.OneLogin_Saml2_Authn_Request">
<em class="property">class </em><tt class="descclassname">onelogin.saml2.authn_request.</tt><tt class="descname">OneLogin_Saml2_Authn_Request</tt><big>(</big><em>settings</em>, <em>force_authn=False</em>, <em>is_passive=False</em><big>)</big><a class="reference internal" href="_modules/saml2/authn_request.html#OneLogin_Saml2_Authn_Request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.authn_request.OneLogin_Saml2_Authn_Request" title="Permalink to this definition">¶</a></dt>
<dd><dl class="method">
<dt id="saml2.authn_request.OneLogin_Saml2_Authn_Request.get_request">
<tt class="descname">get_request</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/authn_request.html#OneLogin_Saml2_Authn_Request.get_request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.authn_request.OneLogin_Saml2_Authn_Request.get_request" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns unsigned AuthnRequest.
:return: Unsigned AuthnRequest
:rtype: str object</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-saml2.constants">
<span id="constants-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">constants</span></tt> Class<a class="headerlink" href="#module-saml2.constants" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="saml2.constants.OneLogin_Saml2_Constants">
<em class="property">class </em><tt class="descclassname">onelogin.saml2.constants.</tt><tt class="descname">OneLogin_Saml2_Constants</tt><a class="reference internal" href="_modules/saml2/constants.html#OneLogin_Saml2_Constants"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.AC_KERBEROS">
<tt class="descname">AC_KERBEROS</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.AC_KERBEROS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.AC_PASSWORD">
<tt class="descname">AC_PASSWORD</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.AC_PASSWORD" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.AC_SMARTCARD">
<tt class="descname">AC_SMARTCARD</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Smartcard'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.AC_SMARTCARD" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.AC_UNSPECIFIED">
<tt class="descname">AC_UNSPECIFIED</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.AC_UNSPECIFIED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.AC_X509">
<tt class="descname">AC_X509</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.AC_X509" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.ALOWED_CLOCK_DRIFT">
<tt class="descname">ALOWED_CLOCK_DRIFT</tt><em class="property"> = 180</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.ALOWED_CLOCK_DRIFT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.ATTRNAME_FORMAT_BASIC">
<tt class="descname">ATTRNAME_FORMAT_BASIC</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.ATTRNAME_FORMAT_BASIC" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.ATTRNAME_FORMAT_UNSPECIFIED">
<tt class="descname">ATTRNAME_FORMAT_UNSPECIFIED</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.ATTRNAME_FORMAT_UNSPECIFIED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.ATTRNAME_FORMAT_URI">
<tt class="descname">ATTRNAME_FORMAT_URI</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.ATTRNAME_FORMAT_URI" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.BINDING_DEFLATE">
<tt class="descname">BINDING_DEFLATE</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:bindings:URL-Encoding:DEFLATE'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.BINDING_DEFLATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.BINDING_HTTP_ARTIFACT">
<tt class="descname">BINDING_HTTP_ARTIFACT</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.BINDING_HTTP_ARTIFACT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.BINDING_HTTP_POST">
<tt class="descname">BINDING_HTTP_POST</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.BINDING_HTTP_POST" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT">
<tt class="descname">BINDING_HTTP_REDIRECT</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.BINDING_SOAP">
<tt class="descname">BINDING_SOAP</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.BINDING_SOAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.CM_BEARER">
<tt class="descname">CM_BEARER</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:cm:bearer'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.CM_BEARER" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.CM_HOLDER_KEY">
<tt class="descname">CM_HOLDER_KEY</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:cm:holder-of-key'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.CM_HOLDER_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.CM_SENDER_VOUCHES">
<tt class="descname">CM_SENDER_VOUCHES</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:cm:sender-vouches'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.CM_SENDER_VOUCHES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NAMEID_EMAIL_ADDRESS">
<tt class="descname">NAMEID_EMAIL_ADDRESS</tt><em class="property"> = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NAMEID_EMAIL_ADDRESS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NAMEID_ENCRYPTED">
<tt class="descname">NAMEID_ENCRYPTED</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:nameid-format:encrypted'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NAMEID_ENCRYPTED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NAMEID_ENTITY">
<tt class="descname">NAMEID_ENTITY</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NAMEID_ENTITY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NAMEID_KERBEROS">
<tt class="descname">NAMEID_KERBEROS</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NAMEID_KERBEROS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NAMEID_PERSISTENT">
<tt class="descname">NAMEID_PERSISTENT</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NAMEID_PERSISTENT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NAMEID_TRANSIENT">
<tt class="descname">NAMEID_TRANSIENT</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NAMEID_TRANSIENT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME">
<tt class="descname">NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME</tt><em class="property"> = 'urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NAMEID_X509_SUBJECT_NAME">
<tt class="descname">NAMEID_X509_SUBJECT_NAME</tt><em class="property"> = 'urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NAMEID_X509_SUBJECT_NAME" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NSMAP">
<tt class="descname">NSMAP</tt><em class="property"> = {'xenc': 'http://www.w3.org/2001/04/xmlenc#', 'samlp': 'urn:oasis:names:tc:SAML:2.0:protocol', 'ds': 'http://www.w3.org/2000/09/xmldsig#', 'saml': 'urn:oasis:names:tc:SAML:2.0:assertion'}</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NSMAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NS_DS">
<tt class="descname">NS_DS</tt><em class="property"> = 'http://www.w3.org/2000/09/xmldsig#'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NS_DS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NS_MD">
<tt class="descname">NS_MD</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:metadata'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NS_MD" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NS_SAML">
<tt class="descname">NS_SAML</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:assertion'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NS_SAML" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NS_SAMLP">
<tt class="descname">NS_SAMLP</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:protocol'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NS_SAMLP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NS_SOAP">
<tt class="descname">NS_SOAP</tt><em class="property"> = 'http://schemas.xmlsoap.org/soap/envelope/'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NS_SOAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NS_XENC">
<tt class="descname">NS_XENC</tt><em class="property"> = 'http://www.w3.org/2001/04/xmlenc#'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NS_XENC" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NS_XS">
<tt class="descname">NS_XS</tt><em class="property"> = 'http://www.w3.org/2001/XMLSchema'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NS_XS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.NS_XSI">
<tt class="descname">NS_XSI</tt><em class="property"> = 'http://www.w3.org/2001/XMLSchema-instance'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.NS_XSI" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.RSA_SHA1">
<tt class="descname">RSA_SHA1</tt><em class="property"> = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.RSA_SHA1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.STATUS_NO_PASSIVE">
<tt class="descname">STATUS_NO_PASSIVE</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:status:NoPassive'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.STATUS_NO_PASSIVE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.STATUS_PARTIAL_LOGOUT">
<tt class="descname">STATUS_PARTIAL_LOGOUT</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:status:PartialLogout'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.STATUS_PARTIAL_LOGOUT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.STATUS_PROXY_COUNT_EXCEEDED">
<tt class="descname">STATUS_PROXY_COUNT_EXCEEDED</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.STATUS_PROXY_COUNT_EXCEEDED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.STATUS_REQUESTER">
<tt class="descname">STATUS_REQUESTER</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:status:Requester'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.STATUS_REQUESTER" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.STATUS_RESPONDER">
<tt class="descname">STATUS_RESPONDER</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:status:Responder'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.STATUS_RESPONDER" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.STATUS_SUCCESS">
<tt class="descname">STATUS_SUCCESS</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:status:Success'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.STATUS_SUCCESS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.constants.OneLogin_Saml2_Constants.STATUS_VERSION_MISMATCH">
<tt class="descname">STATUS_VERSION_MISMATCH</tt><em class="property"> = 'urn:oasis:names:tc:SAML:2.0:status:VersionMismatch'</em><a class="headerlink" href="#saml2.constants.OneLogin_Saml2_Constants.STATUS_VERSION_MISMATCH" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-saml2.errors">
<span id="errors-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">errors</span></tt> Class<a class="headerlink" href="#module-saml2.errors" title="Permalink to this headline">¶</a></h2>
<dl class="exception">
<dt id="saml2.errors.OneLogin_Saml2_Error">
<em class="property">exception </em><tt class="descclassname">onelogin.saml2.errors.</tt><tt class="descname">OneLogin_Saml2_Error</tt><big>(</big><em>message</em>, <em>code=0</em>, <em>errors=None</em><big>)</big><a class="reference internal" href="_modules/saml2/errors.html#OneLogin_Saml2_Error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p>
<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.METADATA_SP_INVALID">
<tt class="descname">METADATA_SP_INVALID</tt><em class="property"> = 3</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.METADATA_SP_INVALID" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.PRIVATE_KEY_FILE_NOT_FOUND">
<tt class="descname">PRIVATE_KEY_FILE_NOT_FOUND</tt><em class="property"> = 7</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.PRIVATE_KEY_FILE_NOT_FOUND" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.PUBLIC_CERT_FILE_NOT_FOUND">
<tt class="descname">PUBLIC_CERT_FILE_NOT_FOUND</tt><em class="property"> = 6</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.PUBLIC_CERT_FILE_NOT_FOUND" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.REDIRECT_INVALID_URL">
<tt class="descname">REDIRECT_INVALID_URL</tt><em class="property"> = 5</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.REDIRECT_INVALID_URL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.SAML_LOGOUTMESSAGE_NOT_FOUND">
<tt class="descname">SAML_LOGOUTMESSAGE_NOT_FOUND</tt><em class="property"> = 9</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.SAML_LOGOUTMESSAGE_NOT_FOUND" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.SAML_LOGOUTREQUEST_INVALID">
<tt class="descname">SAML_LOGOUTREQUEST_INVALID</tt><em class="property"> = 10</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.SAML_LOGOUTREQUEST_INVALID" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.SAML_LOGOUTRESPONSE_INVALID">
<tt class="descname">SAML_LOGOUTRESPONSE_INVALID</tt><em class="property"> = 11</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.SAML_LOGOUTRESPONSE_INVALID" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND">
<tt class="descname">SAML_RESPONSE_NOT_FOUND</tt><em class="property"> = 8</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.SAML_SINGLE_LOGOUT_NOT_SUPPORTED">
<tt class="descname">SAML_SINGLE_LOGOUT_NOT_SUPPORTED</tt><em class="property"> = 12</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.SAML_SINGLE_LOGOUT_NOT_SUPPORTED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.SETTINGS_FILE_NOT_FOUND">
<tt class="descname">SETTINGS_FILE_NOT_FOUND</tt><em class="property"> = 0</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.SETTINGS_FILE_NOT_FOUND" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.SETTINGS_INVALID">
<tt class="descname">SETTINGS_INVALID</tt><em class="property"> = 2</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.SETTINGS_INVALID" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.SETTINGS_INVALID_SYNTAX">
<tt class="descname">SETTINGS_INVALID_SYNTAX</tt><em class="property"> = 1</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.SETTINGS_INVALID_SYNTAX" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.errors.OneLogin_Saml2_Error.SP_CERTS_NOT_FOUND">
<tt class="descname">SP_CERTS_NOT_FOUND</tt><em class="property"> = 4</em><a class="headerlink" href="#saml2.errors.OneLogin_Saml2_Error.SP_CERTS_NOT_FOUND" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-saml2.logout_request">
<span id="logout-request-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">logout_request</span></tt> Class<a class="headerlink" href="#module-saml2.logout_request" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="saml2.logout_request.OneLogin_Saml2_Logout_Request">
<em class="property">class </em><tt class="descclassname">onelogin.saml2.logout_request.</tt><tt class="descname">OneLogin_Saml2_Logout_Request</tt><big>(</big><em>settings</em>, <em>request=None</em>, <em>name_id=None</em>, <em>session_index=None</em><big>)</big><a class="reference internal" href="_modules/saml2/logout_request.html#OneLogin_Saml2_Logout_Request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_request.OneLogin_Saml2_Logout_Request" title="Permalink to this definition">¶</a></dt>
<dd><dl class="staticmethod">
<dt id="saml2.logout_request.OneLogin_Saml2_Logout_Request.get_id">
<em class="property">static </em><tt class="descname">get_id</tt><big>(</big><em>request</em><big>)</big><a class="reference internal" href="_modules/saml2/logout_request.html#OneLogin_Saml2_Logout_Request.get_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_request.OneLogin_Saml2_Logout_Request.get_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the ID of the Logout Request
:param request: Logout Request Message
:type request: string|DOMDocument
:return: string ID
:rtype: str object</p>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.logout_request.OneLogin_Saml2_Logout_Request.get_issuer">
<em class="property">static </em><tt class="descname">get_issuer</tt><big>(</big><em>request</em><big>)</big><a class="reference internal" href="_modules/saml2/logout_request.html#OneLogin_Saml2_Logout_Request.get_issuer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_request.OneLogin_Saml2_Logout_Request.get_issuer" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the Issuer of the Logout Request Message
:param request: Logout Request Message
:type request: string|DOMDocument
:return: The Issuer
:rtype: string</p>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.logout_request.OneLogin_Saml2_Logout_Request.get_name_id">
<em class="property">static </em><tt class="descname">get_name_id</tt><big>(</big><em>request</em>, <em>key=None</em><big>)</big><a class="reference internal" href="_modules/saml2/logout_request.html#OneLogin_Saml2_Logout_Request.get_name_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_request.OneLogin_Saml2_Logout_Request.get_name_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the NameID of the Logout Request Message
:param request: Logout Request Message
:type request: string|DOMDocument
:param key: The SP key
:type key: string
:return: Name ID Value
:rtype: string</p>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.logout_request.OneLogin_Saml2_Logout_Request.get_name_id_data">
<em class="property">static </em><tt class="descname">get_name_id_data</tt><big>(</big><em>request</em>, <em>key=None</em><big>)</big><a class="reference internal" href="_modules/saml2/logout_request.html#OneLogin_Saml2_Logout_Request.get_name_id_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_request.OneLogin_Saml2_Logout_Request.get_name_id_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the NameID Data of the the Logout Request
:param request: Logout Request Message
:type request: string|DOMDocument
:param key: The SP key
:type key: string
:return: Name ID Data (Value, Format, NameQualifier, SPNameQualifier)
:rtype: dict</p>
</dd></dl>

<dl class="method">
<dt id="saml2.logout_request.OneLogin_Saml2_Logout_Request.get_request">
<tt class="descname">get_request</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/logout_request.html#OneLogin_Saml2_Logout_Request.get_request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_request.OneLogin_Saml2_Logout_Request.get_request" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the Logout Request defated, base64encoded
:return: Deflated base64 encoded Logout Request
:rtype: str object</p>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.logout_request.OneLogin_Saml2_Logout_Request.get_session_indexes">
<em class="property">static </em><tt class="descname">get_session_indexes</tt><big>(</big><em>request</em><big>)</big><a class="reference internal" href="_modules/saml2/logout_request.html#OneLogin_Saml2_Logout_Request.get_session_indexes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_request.OneLogin_Saml2_Logout_Request.get_session_indexes" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the SessionIndexes from the Logout Request
:param request: Logout Request Message
:type request: string|DOMDocument
:return: The SessionIndex value
:rtype: list</p>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.logout_request.OneLogin_Saml2_Logout_Request.is_valid">
<em class="property">static </em><tt class="descname">is_valid</tt><big>(</big><em>settings</em>, <em>request</em>, <em>get_data</em>, <em>debug=False</em><big>)</big><a class="reference internal" href="_modules/saml2/logout_request.html#OneLogin_Saml2_Logout_Request.is_valid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_request.OneLogin_Saml2_Logout_Request.is_valid" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if the Logout Request recieved is valid
:param settings: Settings
:type settings: OneLogin_Saml2_Settings
:param request: Logout Request Message
:type request: string|DOMDocument
:return: If the Logout Request is or not valid
:rtype: boolean</p>
</dd></dl>

<dl class="method">
<dt id="saml2.logout_request.OneLogin_Saml2_Logout_Request.get_error">
<tt class="descname">get_error</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/logout_request.html#OneLogin_Saml2_Logout_Request.get_request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_request.OneLogin_Saml2_Logout_Request.get_error" title="Permalink to this definition">¶</a></dt>
<dd><p>After execute a validation process, if fails this method returns the cause
:rtype: str object</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-saml2.logout_response">
<span id="logout-response-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">logout_response</span></tt> Class<a class="headerlink" href="#module-saml2.logout_response" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="saml2.logout_response.OneLogin_Saml2_Logout_Response">
<em class="property">class </em><tt class="descclassname">onelogin.saml2.logout_response.</tt><tt class="descname">OneLogin_Saml2_Logout_Response</tt><big>(</big><em>settings</em>, <em>response=None</em><big>)</big><a class="reference internal" href="_modules/saml2/logout_response.html#OneLogin_Saml2_Logout_Response"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_response.OneLogin_Saml2_Logout_Response" title="Permalink to this definition">¶</a></dt>
<dd><dl class="method">
<dt id="saml2.logout_response.OneLogin_Saml2_Logout_Response.build">
<tt class="descname">build</tt><big>(</big><em>in_response_to</em><big>)</big><a class="reference internal" href="_modules/saml2/logout_response.html#OneLogin_Saml2_Logout_Response.build"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_response.OneLogin_Saml2_Logout_Response.build" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a Logout Response object.
:param in_response_to: InResponseTo value for the Logout Response.
:type in_response_to: string</p>
</dd></dl>

<dl class="method">
<dt id="saml2.logout_response.OneLogin_Saml2_Logout_Response.get_issuer">
<tt class="descname">get_issuer</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/logout_response.html#OneLogin_Saml2_Logout_Response.get_issuer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_response.OneLogin_Saml2_Logout_Response.get_issuer" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the Issuer of the Logout Response Message
:return: The Issuer
:rtype: string</p>
</dd></dl>

<dl class="method">
<dt id="saml2.logout_response.OneLogin_Saml2_Logout_Response.get_response">
<tt class="descname">get_response</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/logout_response.html#OneLogin_Saml2_Logout_Response.get_response"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_response.OneLogin_Saml2_Logout_Response.get_response" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a Logout Response object.
:return: Logout Response deflated and base64 encoded
:rtype: string</p>
</dd></dl>

<dl class="method">
<dt id="saml2.logout_response.OneLogin_Saml2_Logout_Response.get_status">
<tt class="descname">get_status</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/logout_response.html#OneLogin_Saml2_Logout_Response.get_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_response.OneLogin_Saml2_Logout_Response.get_status" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the Status
:return: The Status
:rtype: string</p>
</dd></dl>

<dl class="method">
<dt id="saml2.logout_response.OneLogin_Saml2_Logout_Response.is_valid">
<tt class="descname">is_valid</tt><big>(</big><em>request_data</em>, <em>request_id=None</em><big>)</big><a class="reference internal" href="_modules/saml2/logout_response.html#OneLogin_Saml2_Logout_Response.is_valid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_response.OneLogin_Saml2_Logout_Response.is_valid" title="Permalink to this definition">¶</a></dt>
<dd><p>Determines if the SAML LogoutResponse is valid
:param request_id: The ID of the LogoutRequest sent by this SP to the IdP
:type request_id: string
:return: Returns if the SAML LogoutResponse is or not valid
:rtype: boolean</p>
</dd></dl>

<dl class="method">
<dt id="saml2.logout_response.OneLogin_Saml2_Logout_Response.get_error">
<tt class="descname">get_error</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/logout_response.html#OneLogin_Saml2_Logout_Response.get_request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.logout_response.OneLogin_Saml2_Logout_Response.get_error" title="Permalink to this definition">¶</a></dt>
<dd><p>After execute a validation process, if fails this method returns the cause
:rtype: str object</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-saml2.metadata">
<span id="metadata-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">metadata</span></tt> Class<a class="headerlink" href="#module-saml2.metadata" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="saml2.metadata.OneLogin_Saml2_Metadata">
<em class="property">class </em><tt class="descclassname">onelogin.saml2.metadata.</tt><tt class="descname">OneLogin_Saml2_Metadata</tt><a class="reference internal" href="_modules/saml2/metadata.html#OneLogin_Saml2_Metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.metadata.OneLogin_Saml2_Metadata" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="saml2.metadata.OneLogin_Saml2_Metadata.TIME_CACHED">
<tt class="descname">TIME_CACHED</tt><em class="property"> = 604800</em><a class="headerlink" href="#saml2.metadata.OneLogin_Saml2_Metadata.TIME_CACHED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="saml2.metadata.OneLogin_Saml2_Metadata.TIME_VALID">
<tt class="descname">TIME_VALID</tt><em class="property"> = 172800</em><a class="headerlink" href="#saml2.metadata.OneLogin_Saml2_Metadata.TIME_VALID" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="staticmethod">
<dt id="saml2.metadata.OneLogin_Saml2_Metadata.add_x509_key_descriptors">
<em class="property">static </em><tt class="descname">add_x509_key_descriptors</tt><big>(</big><em>metadata</em>, <em>cert</em><big>)</big><a class="reference internal" href="_modules/saml2/metadata.html#OneLogin_Saml2_Metadata.add_x509_key_descriptors"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.metadata.OneLogin_Saml2_Metadata.add_x509_key_descriptors" title="Permalink to this definition">¶</a></dt>
<dd><p>Add the x509 descriptors (sign/encriptation to the metadata
The same cert will be used for sign/encrypt</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>metadata</strong> (<em>string</em>) &#8211; SAML Metadata XML</li>
<li><strong>cert</strong> (<em>string</em>) &#8211; x509 cert</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Metadata with KeyDescriptors</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.metadata.OneLogin_Saml2_Metadata.builder">
<em class="property">static </em><tt class="descname">builder</tt><big>(</big><em>sp</em>, <em>authnsign=False</em>, <em>wsign=False</em>, <em>valid_until=None</em>, <em>cache_duration=None</em>, <em>contacts=None</em>, <em>organization=None</em><big>)</big><a class="reference internal" href="_modules/saml2/metadata.html#OneLogin_Saml2_Metadata.builder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.metadata.OneLogin_Saml2_Metadata.builder" title="Permalink to this definition">¶</a></dt>
<dd><p>Build the metadata of the SP</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>sp</strong> (<em>string</em>) &#8211; The SP data</li>
<li><strong>authnsign</strong> (<em>string</em>) &#8211; authnRequestsSigned attribute</li>
<li><strong>wsign</strong> (<em>string</em>) &#8211; wantAssertionsSigned attribute</li>
<li><strong>valid_until</strong> (<em>DateTime</em>) &#8211; Metadata&#8217;s valid time</li>
<li><strong>cache_duration</strong> (<em>Timestamp</em>) &#8211; Duration of the cache in seconds</li>
<li><strong>contacts</strong> (<em>dict</em>) &#8211; Contacts info</li>
<li><strong>organization</strong> (<em>dict</em>) &#8211; Organization ingo</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.metadata.OneLogin_Saml2_Metadata.sign_metadata">
<em class="property">static </em><tt class="descname">sign_metadata</tt><big>(</big><em>metadata</em>, <em>key</em>, <em>cert</em><big>)</big><a class="reference internal" href="_modules/saml2/metadata.html#OneLogin_Saml2_Metadata.sign_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.metadata.OneLogin_Saml2_Metadata.sign_metadata" title="Permalink to this definition">¶</a></dt>
<dd><p>Sign the metadata with the key/cert provided</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>metadata</strong> (<em>string</em>) &#8211; SAML Metadata XML</li>
<li><strong>key</strong> (<em>string</em>) &#8211; x509 key</li>
<li><strong>cert</strong> (<em>string</em>) &#8211; x509 cert</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Signed Metadata</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-saml2.response">
<span id="response-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">response</span></tt> Class<a class="headerlink" href="#module-saml2.response" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="saml2.response.OneLogin_Saml2_Response">
<em class="property">class </em><tt class="descclassname">onelogin.saml2.response.</tt><tt class="descname">OneLogin_Saml2_Response</tt><big>(</big><em>settings</em>, <em>response</em><big>)</big><a class="reference internal" href="_modules/saml2/response.html#OneLogin_Saml2_Response"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.response.OneLogin_Saml2_Response" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<dl class="method">
<dt id="saml2.response.OneLogin_Saml2_Response.check_status">
<tt class="descname">check_status</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/response.html#OneLogin_Saml2_Response.check_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.response.OneLogin_Saml2_Response.check_status" title="Permalink to this definition">¶</a></dt>
<dd><p>Check if the status of the response is success or not</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body">Exception. If the status is not success</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.response.OneLogin_Saml2_Response.get_attributes">
<tt class="descname">get_attributes</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/response.html#OneLogin_Saml2_Response.get_attributes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.response.OneLogin_Saml2_Response.get_attributes" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the Attributes from the AttributeStatement element.
EncryptedAttributes are not supported</p>
</dd></dl>

<dl class="method">
<dt id="saml2.response.OneLogin_Saml2_Response.get_audiences">
<tt class="descname">get_audiences</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/response.html#OneLogin_Saml2_Response.get_audiences"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.response.OneLogin_Saml2_Response.get_audiences" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the audiences</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The valid audiences for the SAML Response</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.response.OneLogin_Saml2_Response.get_issuers">
<tt class="descname">get_issuers</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/response.html#OneLogin_Saml2_Response.get_issuers"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.response.OneLogin_Saml2_Response.get_issuers" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the issuers (from message and from assertion)</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The issuers</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.response.OneLogin_Saml2_Response.get_nameid">
<tt class="descname">get_nameid</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/response.html#OneLogin_Saml2_Response.get_nameid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.response.OneLogin_Saml2_Response.get_nameid" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the NameID provided by the SAML Response from the IdP</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">NameID (value)</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.response.OneLogin_Saml2_Response.get_nameid_data">
<tt class="descname">get_nameid_data</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/response.html#OneLogin_Saml2_Response.get_nameid_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.response.OneLogin_Saml2_Response.get_nameid_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the NameID Data provided by the SAML Response from the IdP</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Name ID Data (Value, Format, NameQualifier, SPNameQualifier)</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.response.OneLogin_Saml2_Response.get_session_index">
<tt class="descname">get_session_index</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/response.html#OneLogin_Saml2_Response.get_session_index"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.response.OneLogin_Saml2_Response.get_session_index" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the SessionIndex from the AuthnStatement
Could be used to be stored in the local session in order
to be used in a future Logout Request that the SP could
send to the SP, to set what specific session must be deleted</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The SessionIndex value</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string|None</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.response.OneLogin_Saml2_Response.get_session_not_on_or_after">
<tt class="descname">get_session_not_on_or_after</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/response.html#OneLogin_Saml2_Response.get_session_not_on_or_after"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.response.OneLogin_Saml2_Response.get_session_not_on_or_after" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the SessionNotOnOrAfter from the AuthnStatement
Could be used to set the local session expiration</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The SessionNotOnOrAfter value</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">time|None</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.response.OneLogin_Saml2_Response.is_valid">
<tt class="descname">is_valid</tt><big>(</big><em>request_data</em>, <em>request_id=None</em><big>)</big><a class="reference internal" href="_modules/saml2/response.html#OneLogin_Saml2_Response.is_valid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.response.OneLogin_Saml2_Response.is_valid" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructs the response object.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>request_id</strong> (<em>string</em>) &#8211; Optional argument. The ID of the AuthNRequest sent by this SP to the IdP</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">True if the SAML Response is valid, False if not</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.response.OneLogin_Saml2_Response.validate_num_assertions">
<tt class="descname">validate_num_assertions</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/response.html#OneLogin_Saml2_Response.validate_num_assertions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.response.OneLogin_Saml2_Response.validate_num_assertions" title="Permalink to this definition">¶</a></dt>
<dd><p>Verifies that the document only contains a single Assertion (encrypted or not)</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if only 1 assertion encrypted or not</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.response.OneLogin_Saml2_Response.validate_timestamps">
<tt class="descname">validate_timestamps</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/response.html#OneLogin_Saml2_Response.validate_timestamps"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.response.OneLogin_Saml2_Response.validate_timestamps" title="Permalink to this definition">¶</a></dt>
<dd><p>Verifies that the document is valid according to Conditions Element</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if the condition is valid, False otherwise</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-saml2.settings">
<span id="settings-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">settings</span></tt> Class<a class="headerlink" href="#module-saml2.settings" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="saml2.settings.OneLogin_Saml2_Settings">
<em class="property">class </em><tt class="descclassname">onelogin.saml2.settings.</tt><tt class="descname">OneLogin_Saml2_Settings</tt><big>(</big><em>settings=None</em>, <em>custom_base_path=None</em><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings" title="Permalink to this definition">¶</a></dt>
<dd><dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.check_settings">
<tt class="descname">check_settings</tt><big>(</big><em>settings</em><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.check_settings"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.check_settings" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks the settings info.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>settings</strong> (<em>dict</em>) &#8211; Dict with settings data</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Errors found on the settings data</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.check_sp_certs">
<tt class="descname">check_sp_certs</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.check_sp_certs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.check_sp_certs" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if the x509 certs of the SP exists and are valid.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">If the x509 certs of the SP exists and are valid</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">boolean</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.format_idp_cert">
<tt class="descname">format_idp_cert</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.format_idp_cert"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.format_idp_cert" title="Permalink to this definition">¶</a></dt>
<dd><p>Formats the IdP cert.</p>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_base_path">
<tt class="descname">get_base_path</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_base_path"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_base_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns base path</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The base toolkit folder path</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_cert_path">
<tt class="descname">get_cert_path</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_cert_path"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_cert_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns cert path</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The cert folder path</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_contacts">
<tt class="descname">get_contacts</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_contacts"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_contacts" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets contact data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Contacts info</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_errors">
<tt class="descname">get_errors</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_errors"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_errors" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an array with the errors, the array is empty when the settings is ok.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Errors</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_ext_lib_path">
<tt class="descname">get_ext_lib_path</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_ext_lib_path"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_ext_lib_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns external lib path</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The external library folder path</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_idp_data">
<tt class="descname">get_idp_data</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_idp_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_idp_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the IdP data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">IdP info</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_lib_path">
<tt class="descname">get_lib_path</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_lib_path"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_lib_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns lib path</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The library folder path</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_organization">
<tt class="descname">get_organization</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_organization"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_organization" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets organization data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Organization info</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_schemas_path">
<tt class="descname">get_schemas_path</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_schemas_path"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_schemas_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns schema path</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The schema folder path</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_security_data">
<tt class="descname">get_security_data</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_security_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_security_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets security data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Security info</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_sp_cert">
<tt class="descname">get_sp_cert</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_sp_cert"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_sp_cert" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the x509 public cert of the SP.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">SP public cert</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_sp_data">
<tt class="descname">get_sp_data</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_sp_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_sp_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the SP data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">SP info</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_sp_key">
<tt class="descname">get_sp_key</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_sp_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_sp_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the x509 private key of the SP.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">SP private key</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.get_sp_metadata">
<tt class="descname">get_sp_metadata</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.get_sp_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.get_sp_metadata" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the SP metadata. The XML representation.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">SP metadata (xml)</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.is_debug_active">
<tt class="descname">is_debug_active</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.is_debug_active"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.is_debug_active" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns if the debug is active.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Debug parameter</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">boolean</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.is_strict">
<tt class="descname">is_strict</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.is_strict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.is_strict" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns if the &#8216;strict&#8217; mode is active.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Strict parameter</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">boolean</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.set_strict">
<tt class="descname">set_strict</tt><big>(</big><em>value</em><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.set_strict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.set_strict" title="Permalink to this definition">¶</a></dt>
<dd><p>Activates or deactivates the strict mode.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>xml</strong> (<em>boolean</em>) &#8211; Strict parameter</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="saml2.settings.OneLogin_Saml2_Settings.validate_metadata">
<tt class="descname">validate_metadata</tt><big>(</big><em>xml</em><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#OneLogin_Saml2_Settings.validate_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.OneLogin_Saml2_Settings.validate_metadata" title="Permalink to this definition">¶</a></dt>
<dd><p>Validates an XML SP Metadata.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>xml</strong> (<em>string</em>) &#8211; Metadata&#8217;s XML that will be validate</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The list of found errors</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="saml2.settings.validate_url">
<tt class="descclassname">onelogin.saml2.settings.</tt><tt class="descname">validate_url</tt><big>(</big><em>url</em><big>)</big><a class="reference internal" href="_modules/saml2/settings.html#validate_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.settings.validate_url" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-saml2.utils">
<span id="utils-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">utils</span></tt> Class<a class="headerlink" href="#module-saml2.utils" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="saml2.utils.OneLogin_Saml2_Utils">
<em class="property">class </em><tt class="descclassname">onelogin.saml2.utils.</tt><tt class="descname">OneLogin_Saml2_Utils</tt><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils" title="Permalink to this definition">¶</a></dt>
<dd><dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.add_sign">
<em class="property">static </em><tt class="descname">add_sign</tt><big>(</big><em>xml</em>, <em>key</em>, <em>cert</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.add_sign"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.add_sign" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds signature key and senders certificate to an element (Message or
Assertion).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>xml</strong> &#8211; The element we should sign</li>
<li><strong>key</strong> &#8211; The private key</li>
<li><strong>cert</strong> &#8211; The public</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string | Document</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.calculate_x509_fingerprint">
<em class="property">static </em><tt class="descname">calculate_x509_fingerprint</tt><big>(</big><em>x509_cert</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.calculate_x509_fingerprint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.calculate_x509_fingerprint" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the fingerprint of a x509cert.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>x509_cert</strong> &#8211; x509 cert</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body">string</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Formated fingerprint</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.decode_base64_and_inflate">
<em class="property">static </em><tt class="descname">decode_base64_and_inflate</tt><big>(</big><em>value</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.decode_base64_and_inflate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.decode_base64_and_inflate" title="Permalink to this definition">¶</a></dt>
<dd><p>base64 decodes and then inflates according to RFC1951
:param value: a deflated and encoded string
:return: the string after decoding and inflating</p>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.decrypt_element">
<em class="property">static </em><tt class="descname">decrypt_element</tt><big>(</big><em>encrypted_data</em>, <em>enc_ctx</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.decrypt_element"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.decrypt_element" title="Permalink to this definition">¶</a></dt>
<dd><p>Decrypts an encrypted element.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>encrypted_data</strong> &#8211; The encrypted data.</li>
<li><strong>enc_ctx</strong> &#8211; The encryption context.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first">DOMElement</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Type :</th><td class="field-body"><p class="first">Encryption Context</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The decrypted element.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">DOMElement</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.deflate_and_base64_encode">
<em class="property">static </em><tt class="descname">deflate_and_base64_encode</tt><big>(</big><em>value</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.deflate_and_base64_encode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.deflate_and_base64_encode" title="Permalink to this definition">¶</a></dt>
<dd><p>Deflates and the base64 encodes a string
:param value: The string to deflate and encode
:return: The deflated and encoded string</p>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.delete_local_session">
<em class="property">static </em><tt class="descname">delete_local_session</tt><big>(</big><em>callback=None</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.delete_local_session"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.delete_local_session" title="Permalink to this definition">¶</a></dt>
<dd><p>Deletes the local session.</p>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.format_cert">
<em class="property">static </em><tt class="descname">format_cert</tt><big>(</big><em>cert</em>, <em>heads=True</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.format_cert"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.format_cert" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a x509 cert (adding header &amp; footer if required).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>cert</strong> &#8211; A x509 unformated cert</li>
<li><strong>heads</strong> &#8211; True if we want to include head and footer</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Type :</th><td class="field-body"><p class="first">boolean</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Formated cert</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.format_finger_print">
<em class="property">static </em><tt class="descname">format_finger_print</tt><big>(</big><em>fingerprint</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.format_finger_print"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.format_finger_print" title="Permalink to this definition">¶</a></dt>
<dd><p>Formates a fingerprint.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fingerprint</strong> &#8211; fingerprint</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body">string</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Formated fingerprint</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.generate_name_id">
<em class="property">static </em><tt class="descname">generate_name_id</tt><big>(</big><em>value</em>, <em>sp_nq</em>, <em>sp_format</em>, <em>key=None</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.generate_name_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.generate_name_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Generates a nameID.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>value</strong> &#8211; fingerprint</li>
<li><strong>sp_nq</strong> &#8211; SP Name Qualifier</li>
<li><strong>sp_format</strong> &#8211; SP Format</li>
<li><strong>key</strong> &#8211; SP Key to encrypt the nameID</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">DOMElement | XMLSec nameID</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.generate_unique_id">
<em class="property">static </em><tt class="descname">generate_unique_id</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.generate_unique_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.generate_unique_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Generates an unique string (used for example as ID for assertions).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A unique string</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.get_expire_time">
<em class="property">static </em><tt class="descname">get_expire_time</tt><big>(</big><em>cache_duration=None</em>, <em>valid_until=None</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.get_expire_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.get_expire_time" title="Permalink to this definition">¶</a></dt>
<dd><p>Compares 2 dates and returns the earliest.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>cache_duration</strong> &#8211; The duration, as a string.</li>
<li><strong>valid_until</strong> &#8211; The valid until date, as a string or as a timestamp</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The expiration time.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">int</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.get_self_host">
<em class="property">static </em><tt class="descname">get_self_host</tt><big>(</big><em>request_data</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.get_self_host"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.get_self_host" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the current host.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>request_data</strong> &#8211; The request as a dict</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body">dict</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The current host</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.get_self_url">
<em class="property">static </em><tt class="descname">get_self_url</tt><big>(</big><em>request_data</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.get_self_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.get_self_url" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the URL of the current host + current view + query.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>request_data</strong> &#8211; The request as a dict</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body">dict</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The url of current host + current view + query</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.get_self_url_host">
<em class="property">static </em><tt class="descname">get_self_url_host</tt><big>(</big><em>request_data</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.get_self_url_host"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.get_self_url_host" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the protocol + the current host + the port (if different than
common ports).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>request_data</strong> &#8211; The request as a dict</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body">dict</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Url</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.get_self_url_no_query">
<em class="property">static </em><tt class="descname">get_self_url_no_query</tt><big>(</big><em>request_data</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.get_self_url_no_query"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.get_self_url_no_query" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the URL of the current host + current view.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>request_data</strong> &#8211; The request as a dict</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body">dict</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The url of current host + current view</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.get_status">
<em class="property">static </em><tt class="descname">get_status</tt><big>(</big><em>dom</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.get_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.get_status" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets Status from a Response.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>dom</strong> &#8211; The Response as XML</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body">Document</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The Status, an array with the code and a message.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.is_https">
<em class="property">static </em><tt class="descname">is_https</tt><big>(</big><em>request_data</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.is_https"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.is_https" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if https or http.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>request_data</strong> &#8211; The request as a dict</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body">dict</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">False if https is not active</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">boolean</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.parse_SAML_to_time">
<em class="property">static </em><tt class="descname">parse_SAML_to_time</tt><big>(</big><em>timestr</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.parse_SAML_to_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.parse_SAML_to_time" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(.s+)?Z
to a UNIX timestamp. The sub-second part is ignored.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>time</strong> &#8211; The time we should convert (SAML Timestamp).</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body">string</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Converted to a unix timestamp.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.parse_duration">
<em class="property">static </em><tt class="descname">parse_duration</tt><big>(</big><em>duration</em>, <em>timestamp=None</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.parse_duration"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.parse_duration" title="Permalink to this definition">¶</a></dt>
<dd><p>Interprets a ISO8601 duration value relative to a given timestamp.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>duration</strong> &#8211; The duration, as a string.</li>
<li><strong>timestamp</strong> &#8211; The unix timestamp we should apply the duration to.
Optional, default to the current time.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The new timestamp, after the duration is applied.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">int</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.parse_time_to_SAML">
<em class="property">static </em><tt class="descname">parse_time_to_SAML</tt><big>(</big><em>time</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.parse_time_to_SAML"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.parse_time_to_SAML" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a UNIX timestamp to SAML2 timestamp on the form
yyyy-mm-ddThh:mm:ss(.s+)?Z.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>time</strong> &#8211; The time we should convert (DateTime).</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body">string</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">SAML2 timestamp.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.query">
<em class="property">static </em><tt class="descname">query</tt><big>(</big><em>dom</em>, <em>query</em>, <em>context=None</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.query"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.query" title="Permalink to this definition">¶</a></dt>
<dd><p>Extracts nodes that match the query from the Element</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>dom</strong> &#8211; The root of the lxml objet</li>
<li><strong>query</strong> &#8211; Xpath Expresion</li>
<li><strong>context</strong> &#8211; Context Node</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first">Element</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first">DOMElement</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The queried nodes</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">list</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.redirect">
<em class="property">static </em><tt class="descname">redirect</tt><big>(</big><em>url</em>, <em>parameters={}</em>, <em>request_data={}</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.redirect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.redirect" title="Permalink to this definition">¶</a></dt>
<dd><p>Executes a redirection to the provided url (or return the target url).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; The target url</li>
<li><strong>parameters</strong> &#8211; Extra parameters to be passed as part of the url</li>
<li><strong>request_data</strong> &#8211; The request as a dict</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Type :</th><td class="field-body"><p class="first">dict</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first">dict</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Url</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.validate_sign">
<em class="property">static </em><tt class="descname">validate_sign</tt><big>(</big><em>xml</em>, <em>cert=None</em>, <em>fingerprint=None</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.validate_sign"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.validate_sign" title="Permalink to this definition">¶</a></dt>
<dd><p>Validates a signature (Message or Assertion).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>xml</strong> &#8211; The element we should validate</li>
<li><strong>cert</strong> &#8211; The pubic cert</li>
<li><strong>fingerprint</strong> &#8211; The fingerprint of the public cert</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string | Document</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Type :</th><td class="field-body"><p class="first">string</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.validate_xml">
<em class="property">static </em><tt class="descname">validate_xml</tt><big>(</big><em>xml</em>, <em>schema</em>, <em>debug=False</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.validate_xml"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.validate_xml" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="staticmethod">
<dt id="saml2.utils.OneLogin_Saml2_Utils.write_temp_file">
<em class="property">static </em><tt class="descname">write_temp_file</tt><big>(</big><em>content</em><big>)</big><a class="reference internal" href="_modules/saml2/utils.html#OneLogin_Saml2_Utils.write_temp_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#saml2.utils.OneLogin_Saml2_Utils.write_temp_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes some content into a temporary file and returns it.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>content</strong> &#8211; The file content</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body">string</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The temporary file</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">file-like object</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">OneLogin saml2 Module</a><ul>
<li><a class="reference internal" href="#module-saml2.auth"><tt class="docutils literal"><span class="pre">auth</span></tt> Class</a></li>
<li><a class="reference internal" href="#module-saml2.authn_request"><tt class="docutils literal"><span class="pre">authn_request</span></tt> Class</a></li>
<li><a class="reference internal" href="#module-saml2.constants"><tt class="docutils literal"><span class="pre">constants</span></tt> Class</a></li>
<li><a class="reference internal" href="#module-saml2.errors"><tt class="docutils literal"><span class="pre">errors</span></tt> Class</a></li>
<li><a class="reference internal" href="#module-saml2.logout_request"><tt class="docutils literal"><span class="pre">logout_request</span></tt> Class</a></li>
<li><a class="reference internal" href="#module-saml2.logout_response"><tt class="docutils literal"><span class="pre">logout_response</span></tt> Class</a></li>
<li><a class="reference internal" href="#module-saml2.metadata"><tt class="docutils literal"><span class="pre">metadata</span></tt> Class</a></li>
<li><a class="reference internal" href="#module-saml2.response"><tt class="docutils literal"><span class="pre">response</span></tt> Class</a></li>
<li><a class="reference internal" href="#module-saml2.settings"><tt class="docutils literal"><span class="pre">settings</span></tt> Class</a></li>
<li><a class="reference internal" href="#module-saml2.utils"><tt class="docutils literal"><span class="pre">utils</span></tt> Class</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="index.html"
                        title="previous chapter">Welcome to SAML Python library documentation</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/saml2.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Class Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="index.html" title="Welcome to SAML Python library documentation"
             >previous</a> |</li>
        <li><a href="index.html">SAML Python library classes and methods</a> &raquo;</li>
      </ul>
    </div>
    <div class="footer">
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>
